package com.sgb.kjwl.di.ownerInfoNews;

import com.sgb.kjwl.repository.HomeRepertory;
import com.sgb.kjwl.repository.impl.HomeRepertoryImpl;
import com.sgb.kjwl.view.ui.activity.ownerInfoNews.OwnerInfoNewsActivity;
import com.sgb.kjwl.viewmodel.carrierDemand.CarrierDemandAtvModel;
import com.sgb.kjwl.viewmodel.ownerInfoNews.OwnerInfoNewsAtvModel;
import com.swgk.core.base.di.Activity;
import com.swgk.core.base.api.BaseApiSource;
import com.swgk.core.base.model.preference.BasePreferenceSource;

import dagger.Module;
import dagger.Provides;

@Module
public class OwnerInfoNewsModule {
    private OwnerInfoNewsActivity ownerInfoNewsActivity;

    public OwnerInfoNewsModule(OwnerInfoNewsActivity ownerInfoNewsActivity) {
        this.ownerInfoNewsActivity = ownerInfoNewsActivity;
    }

    @Provides
    @Activity
    HomeRepertory provideHomeRepertory(BaseApiSource apiSource, BasePreferenceSource preferenceSource) {
        return new HomeRepertoryImpl(apiSource, preferenceSource);
    }


    @Provides
    @Activity
    OwnerInfoNewsAtvModel provideOwnerInfoNewsAtvModel(HomeRepertory repertory) {
        return new OwnerInfoNewsAtvModel(ownerInfoNewsActivity, repertory);
    }

}
